package fr.emse.tatiana.analysis.annotation.categorisation;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.ui.IEditorInput;

import fr.emse.tatiana.analysis.annotation.AnnotationAnalysisInput;
import fr.emse.tatiana.display.BadDisplayFile;
import fr.emse.tatiana.replayable.analysis.IAnalysis;


public class CategorisationAnalysisInput extends AnnotationAnalysisInput {

	private IFile categfile;
	
	public CategorisationAnalysisInput(IFile file) {
		super(file);
	}
	
	public CategorisationAnalysisInput(IProject project, IFile categfile) {
		super(project);
		this.categfile = categfile;
	}

	public IAnalysis getModel() throws BadDisplayFile {
		if (model==null) {
			if (file == null) {
				model = new CategorisationAnalysis("UntitledAnalysis"+(ID++),p,categfile);
			} else {
				model = new CategorisationAnalysis(file);
			}
		}
		return model;
	}

}
